home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / prog / objeng.arj / MANUAL.TXT < prev    next >
Encoding:
Text File  |  1993-07-08  |  29.2 KB  |  611 lines

  1.                                             |
  2.                                             | The Object Engine
  3.                                             | C++ Class Library
  4.                                             | and Code Generator
  5.                                             | for The Paradox Engine
  6.                                             |
  7.                                             | Version 0.9
  8.                                             |
  9.                                             | Dr. Mark Brittingham
  10.                                             |
  11.                                             |
  12.                                             |
  13.                                             |
  14.  
  15.  
  16. The Object Engine is a C++ class library that encapsulates the core
  17. functionality of the Paradox Engine database library.  This encapsulation
  18. provides a large degree of OODBMS functionality to engine users. Rather than
  19. spending your time writing functions to copy data back and forth between 
  20. data structures and record buffers, you need only call "Store", and "Link" 
  21. methods of the object engine's persistant classes.  Furthermore, these 
  22. functions (and others) are written for you automatically.  You simply 
  23. specify the fields that will populate your new class, and the Code Generator 
  24. automatically generates the class and all of its methods for you!  The 
  25. generated code will work under both Windows and DOS and can be compiled
  26. with Borland C++ 3.1 (a sample is included to help guide you).  The library
  27. covers Alphanumeric, Short, Long, Double, Float (currency), Date and List 
  28. types (see below).  Support for Blobs will be added in the version 2.0.
  29.  
  30. In addition to these features, the object engine provides a unique database 
  31. list class that allows you to store a heterogeneous set of persistant
  32. objects.  You can construct arbitrarily complex data relationships without 
  33. the need for common (relational) fields by placing pointers to these lists 
  34. within persistant classes.  You gain nearly all of the power of a 
  35. full fledged OODBMS simply by adding the Object Engine library to your
  36. current Paradox Engine application.  Plus, the library is very efficient:
  37. it adds less than 13K to your application (with speed optimization).
  38.  
  39.  
  40. Distribution Policy
  41. -------------------
  42. The files contained on this disk: objeng.cpp, objeng.hpp, manual.txt, and 
  43. GEN2.EXE, are all copyrighted material. However, you may use, copy and 
  44. distribute this software free of charge under the following conditions:
  45.  
  46.   1.  Never change any part of the Copyright statement.
  47.  
  48.   2.  All of the enclosed files must be distributed together.
  49.  
  50.   3.  You must not distribute changed versions of the program.  I do not 
  51.       want to be receiving correspondence about bugs that I have not 
  52.       produced.  If you have a suggestion, contact me at the address below 
  53.       and I will consider your suggestion.  If I incorporate your change, 
  54.       you will be credited in the documentation.
  55.  
  56.   4.  The author is not liable for any damage on your side caused by
  57.       the use of this program.
  58.  
  59.   5.  The author has no duty to remedy for the deficiencies of the
  60.       program.
  61.  
  62.            Copyright (c) 1992, Brittingham Software Design, Inc.
  63.  
  64.   6.  If you wish to distribute this software with publications or
  65.       a product, you must print the BSDI copyright statement somewhere 
  66.       on the disk or on the package.
  67.  
  68. As long as those conditions are satisfied, you do not need to get the 
  69. author's permission to use or to distribute the software.
  70.  
  71.  
  72. How to contact Brittingham Software Design
  73. ------------------------------------------
  74.  
  75. The best way to contact me is to send MAIL to me on CompuServe: 72740,2244.  
  76. If you do not have a CompuServe account, you may write to me at:
  77.  
  78.          Dr. Mark Brittingham
  79.          15 Pheasant Ct.
  80.          Flanders, NJ  07836
  81.  
  82.  
  83. Using the Library
  84. -----------------
  85. To use the library, you should first plan out your database structure.  You
  86. should have a clear idea of the classes needed in your application and their
  87. interrelationships.  Next, run the Gen2.exe application (it runs under 
  88. Microsoft Windows(tm)) and create each of your classes.  Gen2 is quite 
  89. simple.  A single button allows you to create a class or to edit whichever 
  90. class is highlighted in a list of classes.  You can save your class
  91. definitions in a format recognized by Gen2 and restore them later.  Thus,
  92. you need not complete the entire set of class definitions in one sitting.
  93.   
  94. When you are satisfied with the set of classes you have defined, you can 
  95. generate the code to implement these classes as persistant objects with the 
  96. push of a button. You will specify the directory and filename of the header
  97. and C++ files.  Keep in mind that you can go back, change your classes, 
  98. and regenerate your code.  However, any changes YOU make to the generated 
  99. code will be overwritten (unless you use another file name).  Thus, it is 
  100. probably best to either subclass the generated classes or at least to keep 
  101. your own code separate.
  102.  
  103. No further documentation is included for the generator simply because it is
  104. so straightforward.  Please fire it up and see for yourself how quickly you
  105. can generate some real persistant classes.
  106.  
  107. To work with the generated code, you need to do three things
  108.  
  109.         1) include the generated header file in the appropriate code files, 
  110.         2) place the generated C++ file in your project or makefile, and
  111.         3) place the objeng.cpp file in your project/makefile.
  112.  
  113. Remember what you named the header and C++ files during the generate phase
  114. so you know what to include in steps 1 and 2.  The objeng.cpp file is
  115. included in the Object Engine Zip file.
  116.  
  117. Now you are ready to declare, manipulate, store, or retrieve instances of 
  118. the classes you have defined! You never need to worry about initializing the
  119. engine, manipulating or creating tables, or reading or writing data.  Of 
  120. course, you do have control over Paradox Engine initialization as well as 
  121. table manipulation if you need it.  But, for the vast majority of your work, 
  122. you need only deal with standard C++ syntax.
  123.  
  124.  
  125.            Copyright (c) 1992, Brittingham Software Design, Inc.
  126.  
  127. Two Keys To Object Engine Programs
  128. ----------------------------------
  129. Two core ideas will help you to understand how to use the library.  First, to 
  130. store an object in the library, simply call its "Store" method. To retrieve a
  131. database record and place it in an object, you will "link" the object to the 
  132. record.  This can be done either by the contents of a field (possibly a key 
  133. field), or navigationally (first, next, etc.). Thus "linking" is the act of 
  134. making an in-memory data structure reflect an on-disk record. Of course, you 
  135. needn't think of it in terms of database records at all!
  136.  
  137. The following link functions are defined:
  138.           LinkToKey    (one or more key fields)
  139.           LinkToRecord (a record position)
  140.           LinkToField  (contents of a field)
  141.           LinkToID     (objectID - see below)
  142.           LinkToFirst
  143.           LinkToLast
  144.           LinkToNext
  145.           LinkToPrev
  146.  
  147. The second key idea is found in the "objectID".  Each object has an objectID 
  148. associated with it.  When you link an object to a particular database record, 
  149. your object is given the record's unique objectID.  You need to keep this
  150. in mind when working with persistant classes.
  151.  
  152. For example, if you create a new object using the copy constructor or set 
  153. one object to another (using '='), then both will have the same objectID.  
  154. If you change these two objects separately and save them both, then the 
  155. record will reflect the last one stored.  That is, storage is mediated by
  156. the objectID.  An object without an objectID will be stored as new (assuming
  157. that there are no conflicting key fields).  An object whose objectID
  158. matches a record found in the database will update that record. If you simply
  159. keep in mind that an object has an identity that you must respect, you will
  160. have no problem using the library.
  161.  
  162. ***************************************************************************
  163.              Persistant Class Functions  - Introduction
  164.  
  165. When you generate code using gen2.exe, you will see that your class 
  166. definition:
  167.  
  168. a) is derived from "PersistClass", 
  169. b) has one or more variable declarations, 
  170. c) has one or more matching "SetXXX" functions to set the variables, 
  171. d) has one or more "GetXXX" functions to get the value of variables, and
  172. e) has only six other methods (2 Constructors, operator=, Store, Retrieve, 
  173.                                                                 and LinkToKey).  
  174.  
  175. If a class contains a list (an "OEList") of other persistant classes, then 
  176. there is no corresponding  "GetXXX" function and the "SetXXX" function 
  177. returns a non-const pointer to the actual list.  All other returned values 
  178. are const to ensure encapsulation.  You can change the "SetXXX" functions to 
  179. reflect any validity checking or dependent variable manipulations that your 
  180. class requires.  Since the OEList already features its own encapsulation 
  181. (and since the code generator architecture made it a pain to make the list 
  182. variables public), a non-const pointer to the list is returned from the 
  183. "GetXXX" function.
  184.  
  185.            Copyright (c) 1992, Brittingham Software Design, Inc.
  186.  
  187. In addition to the Set and Get functions and the six defined with the class, 
  188. your class inherits many functions for linking to various records as well
  189. as functions for testing status, returning Paradox Engine variables (table
  190. and record handles, etc.), and more.
  191.  
  192. Functions that return a value will return Paradox Engine error codes 
  193. (PXSUCCESS, PXERR_XXX).  In all cases (functions, operators, constructors), 
  194. the variable "status" will be filled with the most recent Paradox operation's
  195. return value (use GetStatus() to inspect). Thus, you will need to be aware of
  196. the Paradox Engine's error codes. 
  197.  
  198. ***************************************************************************
  199.                     Class Function Documentation
  200.  
  201. For purposes of clarity, assume that you have declared a class "Client."  
  202. The following functions would be defined:
  203.  
  204. //------------------- Native (Generated) Functions ------------------------
  205. //-------------------------------------------------------------------------
  206. Constructor:  Client()   [format <ClassName>()]
  207. Creates an instance of Client.  If the client database does not exist, it
  208. is created.  If it is not open, it is automatically opened.  The object does
  209. not reflect any record in the database when first created.  All strings and
  210. lists are empty, all scalar values are set to zero.
  211.  
  212. //-------------------------------------------------------------------------
  213. Constructor: Client(Client& val)   [the copy constructor]
  214. Creates a new, identical instance of Client.  The client database will be
  215. created and open since you must have already created a client to pass in!
  216. The new object reflects all of the values of the passed in object.  OELists
  217. are not copied!  The same OEList pointer is now used in both objects.  If
  218. you make a change to the list using the first object, you are also changing
  219. the list used by the second. Since the list is meant to reflect the database,
  220. this is exactly as it should be!
  221.  
  222. //-------------------------------------------------------------------------
  223. Operator: Client &operator=(Client &)    [the assignment operator]
  224. See the copy constructor.  Best used during the declaration of a reference.
  225.  
  226. //-------------------------------------------------------------------------
  227. Private function: int Retrieve   [note "Private", do not make public!]
  228. Copies from the database record to the class' variables.  Called from all
  229. of the "Link..." functions (see below).
  230. Return Value: PXSUCCESS or other engine error code.
  231.  
  232. //-------------------------------------------------------------------------
  233. Function: int Store()  [see PXRecInsert, PXRecUpdate]
  234. Moves the contents of the object into the database. If the object is already
  235. linked to a database record (either from a link function or because it was
  236. copied from another object) then this will UPDATE the database record. Any
  237. object possessing a non-zero objectID is assumed to be linked to the matching
  238. db record.  If the object is not yet linked to a database record (objectID 
  239. is equal to 0), then calling Store will add it to the database (PXRecInsert).
  240. Note that this function reflects the documentation for PXRecUpdate and 
  241. PXRecInsert: an attempt to enter a duplicate key is an error, a non-keyed
  242. table insert will place the record before the current record, etc.
  243. Return Value: PXSUCCESS or other engine error code.
  244.  
  245.            Copyright (c) 1992, Brittingham Software Design, Inc.
  246.  
  247. //-------------------------------------------------------------------------
  248. Function: int LinkToKey(int numkeys, int mode)  [See also, PXSrchKey]
  249. When you define a class, you can specify one or more of its variables
  250. (starting with the first), as keys.  A key variable corresponds to key 
  251. fields in the database.  To search using key values, you place these values 
  252. in the object's key variables and call this function.  For example, if you
  253. have three key fields and want to search on the first two, you should place
  254. values for these first two key fields in the corresponding variables and
  255. call this function with numkeys = 2.  Set Mode equal to any mode legal under 
  256. the PXSrchKey documentation (SEARCHFIRST, etc.) according to your search
  257. requirements. For example:
  258.         ...
  259.         Client.ID = 1000;
  260.         if (Client.LinkToKey(1, SEARCHFIRST) == PXSUCCESS)
  261.           <do great things...>
  262.  
  263. Note: if the field is not keyed, this function does nothing but return an
  264. error.
  265.  
  266. Return Value: PXSUCCESS or other engine error code.
  267.  
  268. //------------------- Inherited Functions ---------------------------------
  269. //-------------------------------------------------------------------------
  270. Function: int LinkToField(char *fieldname, void *value, int mode)
  271.                                                                                                         [See PXSrchFld]
  272. To search for a specific value in a specific field, pass in the fieldname,
  273. the value (cast to a void pointer), and the search mode.  For example:
  274.  
  275.   client.LinkToField("LNAME", (void *)"Brittingham", SEARCHFIRST)
  276.   client.LinkToField("ID", (void *)&i, SEARCHFIRST)
  277.  
  278. Note that the value must be a void pointer.  If you really want overloaded
  279. functions, let me know.  It takes up more space but might be worth doing.
  280. Note also that searches using compound keys are on the way...
  281.  
  282. Return Value: PXSUCCESS or other engine error code.
  283.  
  284. //-------------------------------------------------------------------------
  285. Function: int LinkToRecord(int position) [See PXRecGoto]
  286. Make object reflect contents of the nth record where n = position.
  287.  
  288. Return Value: PXSUCCESS or other engine error code.
  289.  
  290. //-------------------------------------------------------------------------
  291. Function: int LinkToID(const long &ID)   [See PXSrchFld]
  292. Explicitly set object to database record with objectID = ID.  Should not
  293. generally be needed.  Note, no mode argument since objectIDs are unique.
  294.  
  295. Return Value: PXSUCCESS or other engine error code.
  296.  
  297. //-------------------------------------------------------------------------
  298. Function: int LinkToFirst()
  299. Make object reflect contents of first database record.  If database is
  300. empty, contents are not changed and error code is returned.
  301.  
  302. Return Value: PXSUCCESS or other engine error code.
  303.  
  304.            Copyright (c) 1992, Brittingham Software Design, Inc.
  305.  
  306. //-------------------------------------------------------------------------
  307. Function: int LinkToLast()
  308. Make object reflect contents of last database record.  If database is
  309. empty, contents are not changed and error code is returned.
  310.  
  311. Return Value: PXSUCCESS or other engine error code.
  312.  
  313. //-------------------------------------------------------------------------
  314. Function: int LinkToNext()
  315. Make object reflect contents of next database record.  If there is
  316. no next record, contents are not changed and error code is returned.
  317.  
  318. Return Value: PXSUCCESS or other engine error code.
  319.  
  320. //-------------------------------------------------------------------------
  321. Function: int LinkToPrev()
  322. Make object reflect contents of previous database record. If there is
  323. no previous record, contents are not changed and error code is returned.
  324.  
  325. Return Value: PXSUCCESS or other engine error code.
  326.  
  327. //-------------------------------------------------------------------------
  328. Function: void Unlink();
  329. Removes the objectID from the object.  This allows you to copy an object 
  330. and then unlink it from the database record.  If you then Store the object
  331. it will go in under a new objectID (assuming there is no key conflict).
  332.  
  333. Return Value: None
  334.  
  335. //-------------------------------------------------------------------------
  336. virtual int Destroy()  [See PXRecDelete]
  337. Deletes the database record to which this object corresponds.  If the
  338. object has not been linked, it returns PXERR_RECNOTFOUND.  Does not delete
  339. the object or change any of its values.  Note that deleting an object does
  340. not remove it from the database.
  341.  
  342. Return Value: PXSUCCESS or other engine error code.
  343.  
  344. //-------------------------------------------------------------------------
  345. int NRecs(RECORDNUMBER & nrecs)  [See PXTblNRecs]
  346. Returns the numbers of records in the table that the object works with.
  347.  
  348. Return Value: PXSUCCESS or other engine error code.
  349.  
  350. //-------------------------------------------------------------------------
  351. const int GetStatus()
  352. Returns the status value. Status is set by the most recent Paradox Engine
  353. function.  This function is useful for testing the success of functions
  354. that don't return a status value (constructors and operators) although it
  355. can be used after any Object Engine call.
  356.  
  357. Return Value: PXSUCCESS or other engine error code.
  358.  
  359.            Copyright (c) 1992, Brittingham Software Design, Inc.
  360.  
  361. //-------------------------------------------------------------------------
  362. TABLEHANDLE GetTblHdl()
  363. Returns the Paradox Engine table handle.  Can be used if you want to bypass
  364. the library and work directly with the table.  Since the Object Engine does
  365. not provide direct table manipulation (copy, delete, etc.), you may find
  366. this function useful.
  367.  
  368. Return Value: PXSUCCESS or other engine error code.
  369.  
  370. //-------------------------------------------------------------------------
  371. RECORDHANDLE GetRecHdl()
  372. Returns the Paradox Engine record handle.  Can be used to bypass the library
  373. and work directly with the record buffer.  Should not be needed unless you
  374. want to work with multi-field secondary indices (which will be available in 
  375. the next release anyhow).
  376.  
  377. Return Value: PXSUCCESS or other engine error code.
  378.  
  379. //-------------------------------------------------------------------------
  380. const char *GetTblName()
  381. Returns the name of the table to which this object is attached.
  382.  
  383. Return Value: PXSUCCESS or other engine error code.
  384.  
  385. //-------------------------------------------------------------------------
  386. long GetObjectID()
  387. Returns the objectID.  Should not be needed.
  388.  
  389. Return Value: PXSUCCESS or other engine error code.
  390.  
  391. //-------------------------------------------------------------------------
  392. char GetDeleteFlag()
  393. char SetDeleteFlag(char flag) 
  394.  
  395. GetDeleteFlag and SetDeleteFlag are used in conjunction with OELists.  When
  396. an OEList is deleted or cleared, it will check the deleteFlag for each of
  397. the elements that is points to.  If the deleteFlag is TRUE, the object will
  398. be deleted.  Otherwise it will not.  In both cases, any reference to the
  399. object is removed from the OEList.  Thus, if you create a pointer to an
  400. object that you get from an OEList, you should set its deleteFlag to FALSE
  401. if you want to delete the list but keep the pointer.
  402.  
  403. Return Value: PXSUCCESS or other engine error code.
  404.  
  405. //-------------------------------------------------------------------------
  406. int OEPutDate(const int &fieldno, const struct tm &date) and
  407. int OEGetDate(const int &, struct tm &)
  408.  
  409. Used in the classes derived from PersistClass to place dates into specific
  410. record buffer fields.  Used to simplify the process of generating code.
  411. You should never need to use these functions since you will not work directly
  412. with record buffers.
  413.  
  414. Return Value: PXSUCCESS or other engine error code.
  415.  
  416.  
  417.            Copyright (c) 1992, Brittingham Software Design, Inc.
  418.  
  419. ***************************************************************************
  420.              Object List (OEList) Methods - Introduction
  421.  
  422. You will generally use OELists by declaring a field to be of type '^' in
  423. the code generator.  This will generate all of the code you need to Store
  424. and Retrieve nested classes.  For example, if you have multiple phone 
  425. numbers for a client, you may want to create a nested list of phone number
  426. objects and store it with a client record.  To pursue the example, assume 
  427. that you have declared a class "Client" and a class "Phones."  You want to 
  428. associate zero or more phones with a client but don't want to use a unique
  429. relational field in both tables since a given phone might be used by more 
  430. than one client (a husband and wife, for example).
  431.  
  432. In this case, you can declare the Client class with an OEList called 
  433. "phones."  When working with a client you can add a phone number in the
  434. following manner:
  435.  
  436.         Client client;
  437.         Phone phone;
  438.  
  439.         client.LinkToField("LNAME", (void *)"Brittingham", SEARCHFIRST);
  440.         phone.Setnumber("555-1212");
  441.     client.Getphone()->Insert((PersistClass *)&phone);
  442.         client.Store();
  443.  
  444. Note the following important points:
  445. The phone object Inserted into the list and the link to the client object
  446. are both immediately Stored.  You do NOT need to call Store on an object
  447. that you place in an OEList (whether or not the list is owned by another
  448. PersistClass object).  This means that changes you make to a class's OEList
  449. variables cannot be undone simply by not storing the object.
  450.  
  451. You CAN have arbitrarily nested OELists.  For example, the Phone object
  452. could have a list of people that the phone number serves.  This list may
  453. include the client object defined above.  We avoid recursive infinite loops
  454. by NOT retrieving the data in a list until you take an action (such as 
  455. inserting an object).  This also avoids retrieving a all of the data
  456. associated with a complex object with nested OELists if you just want to see 
  457. a single field. If you want to make sure that all of the data associated
  458. with an OEList is in memory immediately, you can use the OEList::Init() 
  459. function.
  460.  
  461. OELists have listIDs (just as objects have objectIDs).  When you place 
  462. objects in an OEList, the objectID of the object and the listID of the list
  463. are associated and stored.  If you later call the OEList constructor with a
  464. listID (and call Init()), the system will search for all objects that were 
  465. ever put on the list and pull them into memory.  This is how OELists are 
  466. stored on PersistClasses: the listID is stored in the object's table as a
  467. LONG.  When the object is retrieved, the listID is used to construct a new 
  468. OEList (see generated source code).
  469.  
  470. The OEList is both a container and an iterator. This is achieved by having
  471. the "()" (function) operator return the "current" object on the list.  The
  472. "++" operator moves to the next object on the list.  The Reset() function
  473. makes the first object on the list the current object. For example, you can 
  474. do the following:
  475.  
  476.            Copyright (c) 1992, Brittingham Software Design, Inc.
  477.  
  478.         OEList objlist;
  479.         PersistClass* temp;
  480.         Foo* footemp;
  481.  
  482.         objlist.Insert((PersistClass *)fooptr1);  //First position
  483.         objlist.Insert((PersistClass *)fooptr3);  //Second position
  484.         objlist.Insert((PersistClass *)fooptr4);  //Third position
  485.         // objlist() would now return a pointer to fooptr4.
  486.  
  487.         // Move to first position before iterating.
  488.         objlist.Reset();
  489.         while ((temp = objlist++) != NULL)
  490.         {
  491.                 ((Foo *)temp).PrintSelf();  <- Some user-declared function
  492.         }
  493.  
  494.         // OR use a for loop...
  495.         for (objlist.Reset(); footemp = (Foo *)objlist(); objlist++)
  496.         {
  497.                 // Insert after fooptr object with ID of 1 (id is user-declared)
  498.                 if (footemp->Getid() == 1)
  499.                 {
  500.                         objlist.Insert((PersistClass *)fooptr2);
  501.                         break;
  502.                 }
  503.         }
  504.  
  505.  
  506. ***************************************************************************
  507.                 OEList Class Function Documentation
  508.  
  509. //-------------------------------------------------------------------------
  510. Constructor: OEList()
  511. Create a new OEList.  This object will be a simple shell without ID or
  512. any objects inside.
  513.  
  514. //-------------------------------------------------------------------------
  515. Constructor: OEList(long inID);
  516. Create a new OEList.  This object will be a simple shell but will have the
  517. given ID.  When Init() is called, all objects associated with the given
  518. listID will be pulled into memory.
  519.  
  520. //-------------------------------------------------------------------------
  521. int Init()
  522. Instantiate the given OEList.  If no listID has been assigned, generate a
  523. new (unique) listID.  If a listID exists, pull out all associated objects
  524. from the database and store them in memory.
  525.  
  526. Return Value: TRUE or FALSE.
  527.  
  528. //-------------------------------------------------------------------------
  529. Destructor: ~OEList();
  530. Deletes all of the objects pointed to by the OEList EXCEPT those whose
  531. deleteFlag is FALSE.  
  532.  
  533.            Copyright (c) 1992, Brittingham Software Design, Inc.
  534.  
  535. Also, this function WILL CAUSE AN ERROR WINDOW OR MESSAGE to pop up if you 
  536. attempt to delete a list that has multiple pointers to it.  That is, 
  537. whenever an object is copied, it will copy any OEList pointers.  In order to 
  538. be a good citizen, it will also inform each OEList (via the AddReference
  539. function, see below) that a new pointer exists.  When you want to delete a 
  540. list, you should make sure that you check this pointer count. The RIGHT way 
  541. to delete a list is:
  542.  
  543.         if ((oelist != NULL) && (oelist->DeleteOK() == TRUE)) delete oelist;
  544.  
  545. The code generator automatically puts this line into the destructors of all
  546. classes that have OEList elements.  In general, you do not need to worry
  547. about this at all unless you are declaring your own lists and creating 
  548. multiple pointers.  If you just use the code generated by Gen2, you are
  549. guaranteed never to run into any problems.
  550.  
  551. //-------------------------------------------------------------------------
  552. void Insert(PersistClass *curelem)
  553. Inserts a persistant class into an OEList.  If you put an element into the
  554. OEList and want to keep it around even if the list goes away, call the
  555. object's SetDeleteFlag function with an argument of FALSE.  If you delete
  556. an object pointed to by a list you may crash your program if you work with
  557. the list later.
  558.  
  559. //-------------------------------------------------------------------------
  560. void Remove()
  561. Removes the current object from the list (you change the "current object"
  562. by iterating through a list- see above).  If the deleteFlag is TRUE, this
  563. function deletes the object from memory.  Does NOT destroy the object's
  564. corresponding database record.  The on-disk representation of the list is 
  565. immediately updated to reflect this removal.
  566.  
  567. //-------------------------------------------------------------------------
  568. PersistClass *operator()()
  569. Returns the current object.  Does not increment or otherwise change the
  570. state of the list.
  571.  
  572. //-------------------------------------------------------------------------
  573. PersistClass *operator++()
  574. Returns the current object and then increments the "current object" pointer.
  575.  
  576. //-------------------------------------------------------------------------
  577. void Reset()
  578. Moves the "current object" pointer to the first element of the list.
  579.  
  580. //-------------------------------------------------------------------------
  581. int Count()
  582. Returns the number of elements in the OEList.  Do not use this for iterating
  583. unless you are SURE that you will not be changing the list in your iteration.
  584.  
  585. //-------------------------------------------------------------------------
  586. void Clear()
  587. Removes all of the elements on the list.  See the Remove() function.
  588.  
  589. //-------------------------------------------------------------------------
  590. void AddReference()
  591. If you will be creating your own pointers to a list, this function is used
  592. to inform the list of your pointer.
  593.  
  594.            Copyright (c) 1992, Brittingham Software Design, Inc.
  595.  
  596. //-------------------------------------------------------------------------
  597. char DeleteOK()
  598. Decrements the reference count and returns it.  This is the opposite of
  599. AddReference.  You should not call this function unless you are removing
  600. your pointer.  Also, you should delete the list if this function returns 1.
  601. (See the documentation for the destructor).
  602.  
  603. //-------------------------------------------------------------------------
  604. const int GetStatus()
  605. Returns the status of the list.  Can be any of: NOTINIT, READY, or FAIL.
  606.  
  607. //-------------------------------------------------------------------------
  608. const long GetListID()
  609. Returns the listID.  This number is used in a <listID, objectID, TableName>
  610. table to keep track of the associations between lists and objects.
  611.